package com.mmy.service.scenic.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mmy.dao.scenic.TScenicPlanRepository;
import com.mmy.dao.scenic.VScenicPlanRepository;
import com.mmy.domain.scenic.TScenicPlan;
import com.mmy.domain.scenic.VScenicPlan;
import com.mmy.service.scenic.TScenicPlanService;

@Service
public class TScenicPlanServiceImpl implements TScenicPlanService {

	@Autowired
	TScenicPlanRepository tScenicPlanRepository;

	@Autowired
	VScenicPlanRepository vScenicPlanRepository;

	/**
	 * 查找全部
	 * 
	 * @param
	 * @return
	 */
	public List<VScenicPlan> findAll() {
		// TODO Auto-generated method stub
		return vScenicPlanRepository.findAll();
	}

	/**
	 * 通过id查找
	 * 
	 * @param
	 * @return
	 */
	public VScenicPlan findByID(int iPlanID) {
		// TODO Auto-generated method stub
		return vScenicPlanRepository.findByID(iPlanID);
	}

	/**
	 * 新增id
	 * 
	 * @param
	 * @return
	 */
	public void save(int planID) {
		// TODO Auto-generated method stub
		tScenicPlanRepository.save(planID);
	}

	/**
	 * 新增
	 * 
	 * @param
	 * @return
	 */
	public void save(TScenicPlan tScenicPlan) {
		// TODO Auto-generated method stub
		tScenicPlanRepository.save(tScenicPlan);

	}

	/**
	 * 删除
	 * 
	 * @param
	 * @return
	 */
	public void delScenicPlan(List<Integer> lstPlanID) {
		// TODO Auto-generated method stub
		tScenicPlanRepository.delScenicPlan(lstPlanID);
	}

	/**
	 * 通过id查找
	 * 
	 * @param
	 * @return
	 */
	public TScenicPlan findByPlanID(int iPlanID) {
		// TODO Auto-generated method stub
		return tScenicPlanRepository.findByPlanID(iPlanID);
	}

	/**
	 * 通过name查找
	 * 
	 * @param
	 * @return
	 */
	public List<VScenicPlan> findByName(String strScenicName) {
		// TODO Auto-generated method stub
		return vScenicPlanRepository.findByName(strScenicName);
	}

	/**
	 * 通过ScenicID查找
	 * 
	 * @param
	 * @return
	 */
	public List<VScenicPlan> findByScenicID(int iScenicID) {
		// TODO Auto-generated method stub
		// return vScenicPlanRepository.findByScenicID(iScenicID);
		return null;
	}

	/* 查找每个景区最小的价格 hanxl */
	public List<TScenicPlan> findMinPrice() {
		// TODO Auto-generated method stub
		return tScenicPlanRepository.findMinPrice();
	}

}
